﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;

namespace HuaweiCloud.Dotnet.Samples.Common
{
    /// <summary>
    /// 灵活场景中常变的业务实体，定义为组件
    /// </summary>
    public abstract class BaseComponent
    {
        [BsonId]
        [BsonRepresentation(BsonType.ObjectId)]
        public virtual string? Id { get; set; }
    }

    public abstract class BaseComponent<TKey>
    {
        [BsonId]
        [BsonRepresentation(BsonType.ObjectId)]
        public virtual TKey? Id { get; set; }
    }
}
